<?php

namespace DP\EventBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class EventType extends AbstractType
{
    public function buildForm(FormBuilder $obj_builder, array $arr_options)
    {
	    $obj_builder
	    ->add('titre', 'text')
	    ->add('soustitre', 'text')
	    ->add('description', 'textarea')
	    ->add('tags', 'collection', array('type' => new TagType(), 'prototype' => true, 'allow_add' => true))
        ->add('date_debut', 'date')
	    ->add('date_fin', 'date');
    }

    public function getName()
    {
        return 'dp_eventbundle_eventtype';
    }

    public function getDefaultOptions(array $arr_options)
    {
        return array (
            'data_class' => 'DP\EventBundle\Entity\Event',
        );
    }
}